import Vue from 'vue'
import Vuex from 'vuex'
import users from './modules/user'
Vue.use(Vuex)
const modules = {
	users
}
const store = new Vuex.Store({
	modules,
	state: {
		user: {
			id: Number,
			username: "",
			nickname: "张小二",
			mobile: "18820268651",
			avatar: "/static/logo.png",
			score: 0,
			token: "",
			user_id: Number,
			createtime: Number,
			expiretime: 0,
			expires_in: Number,
			level: 0,
			money: 0,
			city: '',
			area: '',
			street: ''
		}
	},
	mutations: {
		SAVE_USER(state,data){
			state.user = data
		},
		SAVE_ITEM(state,data){
			state.user[data.name] = data.data
		}
	},
	actions: {}
});
export default store
